﻿using System;
using System.Collections.Generic;
using System.CodeDom.Compiler;

namespace SWF
{
    public struct BitOr : IAction, IStackManipulator
    {
        public ActionKind ActionId { get { return ActionKind.BitOr; } }
        public uint Version { get { return 5; } }
        public uint Length { get { return 1; } }

        public uint StackPops { get { return 2; } }
        public uint StackPushes { get { return 1; } }
        public int StackChange { get { return -1; } }

        public void Execute(Runtime.Clip clip, Stack<object> stack, Dictionary<string, object> variables, List<string> constantPool, Dictionary<string, List<IAction>> functionmap)
        {
            uint a, b;
            a = (uint)stack.Pop();
            b = (uint)stack.Pop();
            stack.Push(((int)(a | b)).ToString());
        }
    }
}
